<template>
  <el-input v-model="value" readonly @click.stop.native="openDialog" :placeholder="`请选择${$attrs.label || ''}`">
    <template #append>
      <el-link @click.stop="openDialog">选择</el-link>
      <!-- <el-upload :action="upload_url" :headers="{ Authorization: token }">
        <el-button type="primary">上传文件</el-button>
      </el-upload> -->
    </template>
  </el-input>
</template>

<script>
import { mapState } from 'vuex'
import { upload_url } from '@/api/upload'
export default {
  props: ['value'],
  data () {
    return {
      upload_url,
    }
  },
  methods: {
    openDialog () {
      this.$emit('click')
    },
  },
  created () {
  },
  computed: {
    ...mapState('user', ['token']),
  },
}
</script>
